<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>VUE3：v-bind基本使用</title>
  </head>
  <body>
    <div id="app"></div>

    <template id="tpl">
      <!-- v-bind：绑定数据，简写为 `:`-->
      <div>
        <a :href="link" target="_blank">
          <img
            v-bind:src="img"
            alt="Image from unsplash.com"
            style="height: 50vh; object-fit: cover"
          />
        </a>
      </div>
    </template>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
      Vue.createApp({
        template: "#tpl",
        data() {
          return {
            img: "https://images.unsplash.com/photo-1696142990758-581061f2801d",
            link: "https://unsplash.com",
          };
        },
      }).mount("#app");
    </script>
  </body>
</html>
